--- import { type CollectionEntry, getCollection } from "astro:content"; import Comments from "../../components/Comments.astro"; import Layout from "../../layouts/BaseLayout.astro"; import dayjs from "dayjs"; type Props = CollectionEntry<"blog">; export async function getStaticPaths() { const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; }); return posts.map((post) => ({ params: { slug: post.slug }, props: post, })); } const post = Astro.props; const { Content } = await post.render(); const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); ---

{post.data.title}

Posted by {post.data.author}